package com.wnxy.sdd.service.impl;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.model.DeleteObjectsRequest;
import com.aliyun.oss.model.DeleteObjectsResult;
import com.wnxy.sdd.config.OssTemplate;
import com.wnxy.sdd.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@Service
public class FileServiceImpl implements FileService {
    @Autowired
    private OssTemplate ossTemplate;
    @Override
    public String uploadFile(MultipartFile file) {
        return ossTemplate.uploadFile(file);
    }

    @Override
    public void deleteFiles(List<String> set) {
        ossTemplate.deleteFiles(set);
    }
}
